<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWaimaiShopFinishSwitchTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection("mysqlWaiMaiAll")->create('waimai_shop_finish_switch', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('shopId')->default(0);
            $table->tinyInteger('switch')->default(0)->comment('0关 1开');
            $table->unsignedInteger('reservePrepare')->default(0)->comment('预约单备餐提醒-秒');
            $table->unsignedInteger('reserveFinish')->default(0)->comment('预约单出餐提醒-秒');

            $table->integer('createdAt')->default(0)->comment('创建时间');
            $table->integer('createdByUid')->default(0)->comment('创建人');
            $table->integer('updatedAt')->default(0)->comment('修改时间');
            $table->integer('updatedByUid')->default(0)->comment('修改人');

            $table->index(['shopId'], 'idx_shopId');
            $table->comment = '外卖店铺自动出餐配置-店铺主表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connection("mysqlWaiMaiAll")->dropIfExists('waimai_shop_finish_switch');
    }
}
